<html>
<head><meta charset="utf-8"><title>Idea/Request: features per profile · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html">Idea/Request: features per profile</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203567096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203567096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203567096">(Jul 10 2020 at 23:04)</a>:</h4>
<p>I'm not sure where this goes exactly, so I thought I'd just throw it here and we can see if it's even a good plan.</p>
<p>What I'd like to have in rust is the ability to enable a feature (of the current crate or of a dep) based on which build profile is being compiled (dev/release/test/bench). Eg, in the <code>dev</code> profile you could enable features for additional debug checks / traces / etc. Essentially so that crates don't have to exclusively cfg on either <code>debug_assertions</code> being set or not.</p>
<p>Does this sound reasonable and good to anyone else?</p>



<a name="203575296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575296">(Jul 11 2020 at 02:04)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> heh, funny you bring this up</p>



<a name="203575318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575318">(Jul 11 2020 at 02:05)</a>:</h4>
<p>this (or a variation on this) is actually a massive Cargo bug for certain ecosystems and the workarounds make my life miserable when I need to debug/benchmark stuff</p>



<a name="203575332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575332">(Jul 11 2020 at 02:05)</a>:</h4>
<p>might be <a href="https://github.com/rust-lang/cargo/issues/6571">https://github.com/rust-lang/cargo/issues/6571</a></p>



<a name="203575372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575372">(Jul 11 2020 at 02:06)</a>:</h4>
<p>dag. I just edit Cargo.toml by hand when i meed to turn on the extra debugging abilities</p>



<a name="203575375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575375">(Jul 11 2020 at 02:06)</a>:</h4>
<p>potentially also this <a href="https://github.com/rust-lang/cargo/issues/1197">https://github.com/rust-lang/cargo/issues/1197</a></p>



<a name="203575386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575386">(Jul 11 2020 at 02:07)</a>:</h4>
<p>oof, I'm already subscribed to the second one ;_;</p>



<a name="203575388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575388">(Jul 11 2020 at 02:07)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> in our (client's) case one build has to produce both host and wasm binaries and they have conflicting constraints</p>



<a name="203575392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575392">(Jul 11 2020 at 02:07)</a>:</h4>
<p>you can imagine what happens when the wasm build starts pulling in <code>std</code> stuff :P</p>



<a name="203575395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575395">(Jul 11 2020 at 02:07)</a>:</h4>
<p>yike</p>



<a name="203575441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575441">(Jul 11 2020 at 02:08)</a>:</h4>
<p>the workaround involves creating a separate workspace in <code>target/release/wbuild</code> that refers to the original packages by path dependency, and building in there (with a different set of features and Cargo profile configs etc.)</p>



<a name="203575457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575457">(Jul 11 2020 at 02:09)</a>:</h4>
<p>just the other day I had to go in there and spend hours hackily grabbing some LLVM optimization logs that would've just been one <code>cargo rustc</code> command if it didn't need the separate weird setup</p>



<a name="203575462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575462">(Jul 11 2020 at 02:09)</a>:</h4>
<p>(you can't use <code>-p</code> in the wasm-only workspace because all the relevant crates are external dependencies from its viewpoint)</p>



<a name="203575523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575523">(Jul 11 2020 at 02:11)</a>:</h4>
<p>if we keep dealing with this I might try to figure out how hard it would be to extend Cargo to track the requisite data</p>



<a name="203575526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575526">(Jul 11 2020 at 02:11)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> wait! <a href="https://github.com/rust-lang/cargo/issues/1197#issuecomment-590385530">https://github.com/rust-lang/cargo/issues/1197#issuecomment-590385530</a></p>



<a name="203575527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575527">(Jul 11 2020 at 02:11)</a>:</h4>
<p>I missed that :D</p>



<a name="203575572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575572">(Jul 11 2020 at 02:12)</a>:</h4>
<p>&lt;3 <span class="user-mention" data-user-id="120518">@Eric Huss</span></p>



<a name="203575582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575582">(Jul 11 2020 at 02:12)</a>:</h4>
<p>actually I think I opened something related but didn't look at it</p>



<a name="203575590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575590">(Jul 11 2020 at 02:12)</a>:</h4>
<p>oh yeah I already have this in a tab from minutes ago heh <a href="https://github.com/rust-lang/cargo/issues/7914">https://github.com/rust-lang/cargo/issues/7914</a></p>



<a name="203575601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575601">(Jul 11 2020 at 02:13)</a>:</h4>
<p>that's almost what i want</p>



<a name="203575605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203575605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203575605">(Jul 11 2020 at 02:13)</a>:</h4>
<p>right, but for profiles</p>



<a name="203576412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203576412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203576412">(Jul 11 2020 at 02:35)</a>:</h4>
<p>any chance this topic could be moved to <a class="stream" data-stream-id="246057" href="/#narrow/stream/246057-t-cargo">#t-cargo</a>? cc <span class="user-mention" data-user-id="116122">@simulacrum</span> (I don't know all of the admins :P)</p>



<a name="203583577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203583577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203583577">(Jul 11 2020 at 06:33)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> heh I was looking at the list of all unstable Cargo features and it's nice that this already exists <a href="https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#custom-named-profiles">https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#custom-named-profiles</a></p>



<a name="203583635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203583635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203583635">(Jul 11 2020 at 06:35)</a>:</h4>
<p>i vaguely remember that going in</p>



<a name="203592555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Idea/Request%3A%20features%20per%20profile/near/203592555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Idea.2FRequest.3A.20features.20per.20profile.html#203592555">(Jul 11 2020 at 11:26)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="122651" href="/#narrow/stream/122651-general/topic/Idea.2FRequest.3A.20features.20per.20profile">#general &gt; Idea/Request: features per profile</a> by <span class="user-mention silent" data-user-id="116122">simulacrum</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>